<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>Huafeihua</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
  <meta property="og:type" content="website">
<meta property="og:title" content="Huafeihua">
<meta property="og:url" content="http://malone00.gitee.io/index.html">
<meta property="og:site_name" content="Huafeihua">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Huafeihua">
  
    <link rel="alternate" href="/atom.xml" title="Huafeihua" type="application/atom+xml">
  
  
    <link rel="icon" href="/images/tmp.jpg">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/css/highlight.css">
</head>
</html>
<body>
  <div id="fullpage" class="mobile-nav-right">
    
      <div id="wrapper" title="图片来自网络">
    
    
      <header id="header">
  <div id="nav-toggle" class="nav-toggle"></div>
  <div class="head-box global-width">
    <nav class="nav-box nav-right">
      
        <a class="nav-item" href="/" title="">首页</a>
      
        <a class="nav-item" href="/categories" title="">分类</a>
      
        <a class="nav-item" href="/archives" title="">归档</a>
      
        <a class="nav-item" href="/tags" title="">标签</a>
      
        <a class="nav-item" href="/about" title="">关于</a>
      
    </nav>
  </div>
</header>
      <div id="middlecontent" title class="global-width sidebar-left">
        <section id="main">
  
    <article id="post-python-mq" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/2019/01/29/python-mq/">python rabbitmq</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/01/29/python-mq/" class="article-date">
  <time datetime="2019-01-29T06:58:59.000Z" itemprop="datePublished">2019-01-29</time>
</a>
    
    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/rabbit/">rabbit</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <p>consumermq.py<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">import pika</span><br><span class="line"></span><br><span class="line">credentials = pika.PlainCredentials(&apos;pymq&apos;,&apos;123123&apos;)</span><br><span class="line">connection = pika.BlockingConnection(pika.ConnectionParameters(</span><br><span class="line">    &apos;ip&apos;,5672,&apos;test_host&apos;,credentials))</span><br><span class="line">channel = connection.channel()</span><br><span class="line"></span><br><span class="line">channel.queue_declare(queue=&apos;balance&apos;)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">def callback(ch, method, properties, body):</span><br><span class="line">    print(&quot; [x] Received %r&quot; % body)</span><br><span class="line">    print(bytes.decode(body))</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">channel.basic_consume(callback,</span><br><span class="line">                      queue=&apos;balance&apos;,</span><br><span class="line">                      no_ack=True)</span><br><span class="line"></span><br><span class="line">print(&apos; [*] Waiting for messages. To exit press CTRL+C&apos;)</span><br><span class="line">channel.start_consuming()</span><br></pre></td></tr></table></figure></div></p>
<p>server_rabbitmq.py<br><div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">import pika</span><br><span class="line"></span><br><span class="line">credentials = pika.PlainCredentials(&apos;pymq&apos;, &apos;123123&apos;)</span><br><span class="line">connection = pika.BlockingConnection(pika.ConnectionParameters(</span><br><span class="line">    &apos;ip&apos;, 5672, &apos;test_host&apos;, credentials</span><br><span class="line">))</span><br><span class="line">channel = connection.channel()</span><br><span class="line"></span><br><span class="line">#queue</span><br><span class="line">channel.queue_declare(queue=&apos;balance&apos;)</span><br><span class="line"></span><br><span class="line">channel.basic_publish(</span><br><span class="line">    exchange=&apos;&apos;,</span><br><span class="line">    routing_key=&apos;balance&apos;,</span><br><span class="line">    body=&apos;演示环境测试测试&apos;)</span><br><span class="line"></span><br><span class="line">connection.close()</span><br></pre></td></tr></table></figure></div></p>
<pre><code>方法一: 通过访问阿里yum源镜像地址获取.
方法二:直接安装epel源方式:yum install epel-release
</code></pre><p>#6 安装pip<br>默认yum中可能没有<br>安装epel后再试<br>yum install python-pip  成功</p>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-python/Unittest" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/python/Unittest/">Python-Unittest</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/python/Unittest/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/python/">python</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/python/">python</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <p>1.unittest xUnit 系列框架一员<br>2.四个核心<br>test case, (完整的流程， setUp, run, tearDown)<br>test suite, （testloader） unittest.main()<br>test runner,   (textresult texttestrunner  testresult)   输出到控制台或文件（html）<br>test fixture</p>
<p>import unittest</p>
<p>class test(unittest.TestCase):<br>    def test_add(self):<br>        self.assertE qual(3,func.add(1,2)</p>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-项目管理/项目管理2018-07-23" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/项目管理/项目管理2018-07-23/">U项目管理</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/项目管理/项目管理2018-07-23/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/项目管理/">项目管理</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <p>#项目管理</p>
<blockquote>
<p>公司安排做项目审计工作,学习下项目管理相关内容</p>
</blockquote>
<p>五大过程组 </p>
<ol>
<li>启动</li>
</ol>
<ul>
<li>立项 制定项目章程 任命项目经理  识别项目干系人</li>
</ul>
<ol start="2">
<li>计划</li>
</ol>
<ul>
<li>制定实施计划  9大领域的计划 沟通、范围、质量、成本、风险、采购（如果有）</li>
</ul>
<ol start="3">
<li>实施</li>
</ol>
<ul>
<li>分解WBS 任务  阶段验证确认  日报 周报 例会等</li>
</ul>
<ol start="4">
<li>监控</li>
</ol>
<ul>
<li>进度识别控制，风险分析报告，范围确认</li>
</ul>
<ol start="5">
<li>收尾</li>
</ol>
<ul>
<li>项目验收  报告  总结组织过程资产</li>
</ul>
<p>学习资料：<br>《系统集成项目管理工程师教程》–考试用（软考）<br>《项目经理成长手册》–工具书<br>《PMPBOK》–方法论（哪里都可以用）</p>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-随笔/-Kanboard-安装之Windows" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/随笔/-Kanboard-安装之Windows/">Kanboard 安装之Windows</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/随笔/-Kanboard-安装之Windows/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/效率/">效率</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        
<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> Kanboard 安装之Windows</title>
    <style type="text/css" media="all">
      body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
        font-size: 14px;
        line-height: 20px;
        color: #777;
        background-color: white;
      }
      .container {
        width: 700px;
        margin-right: auto;
        margin-left: auto;
      }

      .post {
        font-family: Georgia, "Times New Roman", Times, "SimSun", serif;
        position: relative;
        padding: 70px;
        bottom: 0;
        overflow-y: auto;
        font-size: 16px;
        font-weight: normal;
        line-height: 25px;
        color: #515151;
      }

      .post h1{
        font-size: 50px;
        font-weight: 500;
        line-height: 60px;
        margin-bottom: 40px;
        color: inherit;
      }

      .post p {
        margin: 0 0 35px 0;
      }

      .post img {
        border: 1px solid #D9D9D9;
      }

      .post a {
        color: #28A1C5;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="post">
        <h1 class="title"> Kanboard 安装之Windows</h1>
        <div class="show-content">
          <hr><p>在网上找到了一个看板工具，试用下，闲话少说，开整。</p><p>环境：xampp</p><p>           kanboard<br></p><hr><h1>1.下载</h1><p>地址：<a href="https://kanboard.net/downloads" target="_blank">https://kanboard.net/downloads</a> <br></p><p>由于是windows安装，避免麻烦选择 Stable version。</p><p>下载后 放入xampp  ==》htdocs下</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-164ccbdcef19b870.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-164ccbdcef19b870.png?imageMogr2/auto-orient/strip" data-image-slug="164ccbdcef19b870" data-width="253" data-height="131"><br><div class="image-caption">路径图</div>
</div><p>xampp一键安装，本文不详细介绍，具体可问度娘。</p><h1>2.数据配置</h1><p>mysql 新建数据库 kanboard <br></p><p>小白可用phpmyadmin</p><p>数据库建好要修改kanboard 的配置文件</p><p>config.default.php   复制一个改名为   config.php<br></p><p>默认sqlite 这里使用mysql，里面的参数需修改，都有注释</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-08e77b33437ef494.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-08e77b33437ef494.png?imageMogr2/auto-orient/strip" data-image-slug="08e77b33437ef494" data-width="426" data-height="507"><br><div class="image-caption">配置图</div>
</div><hr><p>这里说下表的生成，有自动模式和手动，自动执行报错，未找到原因，决定手动导入</p><p>phpmyadmin ==》导入  选择文件  kanboard\app\Schema\Sql\mysql.sql</p><p>报错，手动执行sql导入,mysql 字符长度限制：<br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-34df2b60eeedd49a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-34df2b60eeedd49a.png?imageMogr2/auto-orient/strip" data-image-slug="34df2b60eeedd49a" data-width="1352" data-height="173"><br><div class="image-caption"></div>
</div><p>修改长度：</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-7f9ba794060fd616.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-7f9ba794060fd616.png?imageMogr2/auto-orient/strip" data-image-slug="7f9ba794060fd616" data-width="598" data-height="195"><br><div class="image-caption">sql修改</div>
</div><p>启动还是报错，自动改为手动，true==》false</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-c7ab0bf0b31bb0b0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-c7ab0bf0b31bb0b0.png?imageMogr2/auto-orient/strip" data-image-slug="c7ab0bf0b31bb0b0" data-width="995" data-height="313"><br><div class="image-caption">配置修改<br>
</div>
</div><p>终于安装成功:</p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-b0ec1582b84344fd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-b0ec1582b84344fd.png?imageMogr2/auto-orient/strip" data-image-slug="b0ec1582b84344fd" data-width="1135" data-height="495"><br><div class="image-caption">登录界面</div>
</div><p>默认用户名和密码：admin/admin   记得改密码哦！</p><p>登录后的界面：</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-b214323f5db18954.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-b214323f5db18954.png?imageMogr2/auto-orient/strip" data-image-slug="b214323f5db18954" data-width="1345" data-height="466"><br><div class="image-caption">默认页<br>
</div>
</div><br><p>界面看着效果一般，喜欢可以自己修改下，接下来就可以使用了。</p><p> Just enjoy it！<br></p><br><hr>
        </div>
      </div>
    </div>
  </body>
</html>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-运维部署/单网卡实现内外网访问" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/运维部署/单网卡实现内外网访问/">单网卡实现内外网访问</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/运维部署/单网卡实现内外网访问/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        
<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>单网卡实现内外网访问</title>
    <style type="text/css" media="all">
      body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
        font-size: 14px;
        line-height: 20px;
        color: #777;
        background-color: white;
      }
      .container {
        width: 700px;
        margin-right: auto;
        margin-left: auto;
      }

      .post {
        font-family: Georgia, "Times New Roman", Times, "SimSun", serif;
        position: relative;
        padding: 70px;
        bottom: 0;
        overflow-y: auto;
        font-size: 16px;
        font-weight: normal;
        line-height: 25px;
        color: #515151;
      }

      .post h1{
        font-size: 50px;
        font-weight: 500;
        line-height: 60px;
        margin-bottom: 40px;
        color: inherit;
      }

      .post p {
        margin: 0 0 35px 0;
      }

      .post img {
        border: 1px solid #D9D9D9;
      }

      .post a {
        color: #28A1C5;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="post">
        <h1 class="title">单网卡实现内外网访问</h1>
        <div class="show-content">
          <p>1.本示例内外网的IP分配如下：（具体以你所在的网络为准）<br></p><p>内网：IP地址192.168.1.xxx   掩码：255.255.255.0   网关：192.168.1.1</p><p>外网：IP地址10.10.2.xxx  掩码：255.255.255.0   网关：10.10.2.254</p><p>本地配置静态IP及网关信息：</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-aa32cfda5e5ecee7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-aa32cfda5e5ecee7.png?imageMogr2/auto-orient/strip" data-image-slug="aa32cfda5e5ecee7" data-width="414" data-height="430"><br><div class="image-caption"></div>
</div><p>2.点击【高级】-IP设置</p><p>添加10.10.2.31 网关10.10.2.254</p><p>3.打开cmd 命令行窗口</p><p>添加静态路由 <br></p><blockquote><p>route add 10.10.0.0 mask 255.255.0.0 10.10.2.254</p></blockquote><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-a2e75cfc71dda2ce.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-a2e75cfc71dda2ce.png?imageMogr2/auto-orient/strip" data-image-slug="a2e75cfc71dda2ce" data-width="529" data-height="62"><br><div class="image-caption"></div>
</div><p>该命令的作用是把所有访问内网10.10.xxx.xxx的请求转发给内网网关10.10.2.254</p><p>其他请求可以依次添加</p><p>这样就实现了内外网同时访问!<br></p>
        </div>
      </div>
    </div>
  </body>
</html>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-SQL/SQL范围时间随机插入" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/SQL/SQL范围时间随机插入/">SQL范围时间随机插入</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/SQL/SQL范围时间随机插入/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/sql/">sql</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <blockquote>
<p>工作需要有时向数据库插入范围时间段的随机值</p>
</blockquote>
<p>##举例 </p>
<p>##向数据库一列插入字符类型 2017-01  至2018-01</p>
<ol>
<li><p>先查询2017-01 时间值</p>
<div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">select to_char(to_date(&apos;2017-01-01&apos;, &apos;yyyy-MM-dd&apos;), &apos;J&apos;) from dual; </span><br><span class="line">&gt;&gt;&gt;2457755</span><br></pre></td></tr></table></figure></div>
</li>
<li><p>查询随机返回结果，每次查询都在范围内随机取值</p>
<div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">select &quot;TO_CHAR&quot;(to_date(2457755+ trunc(DBMS_RANDOM.VALUE(0, 365)), &apos;J&apos;),&apos;yyyy-mm&apos;) from dual;</span><br><span class="line">&gt;&gt;&gt;2017-09</span><br><span class="line">``` </span><br><span class="line">3.使用</span><br></pre></td></tr></table></figure></div>
</li>
</ol>
<p>update table set col  =  “TO_CHAR”(to_date(2457755+ trunc(DBMS_RANDOM.VALUE(0, 365)), ‘J’),’yyyy-mm’)<br><code>`</code></p>
<blockquote>
<p>插入类型，转换，时间可以按需求自行修改</p>
</blockquote>
<p>—end—</p>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-Ubuntu/Ubuntu安装chrome浏览器" class="article global-container article-type-post" itemscope="" itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/Ubuntu/Ubuntu安装chrome浏览器/">Ubuntu安装chrome</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/Ubuntu/Ubuntu安装chrome浏览器/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/Linux/">Linux</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/ubuntu/">ubuntu</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        <p>三行命令</p>
<div class="highlight-box" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true" data-rel="PLAIN"><figure class="iseeu highlight /plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb </span><br><span class="line">sudo dpkg -i google-chrome*</span><br><span class="line">sudo apt-get install -f</span><br></pre></td></tr></table></figure></div>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-运维部署/使用itsdangerous生成确认令牌" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/运维部署/使用itsdangerous生成确认令牌/">使用itsdangerous生成确认令牌</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/运维部署/使用itsdangerous生成确认令牌/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        
<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用itsdangerous生成确认令牌</title>
    <style type="text/css" media="all">
      body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
        font-size: 14px;
        line-height: 20px;
        color: #777;
        background-color: white;
      }
      .container {
        width: 700px;
        margin-right: auto;
        margin-left: auto;
      }

      .post {
        font-family: Georgia, "Times New Roman", Times, "SimSun", serif;
        position: relative;
        padding: 70px;
        bottom: 0;
        overflow-y: auto;
        font-size: 16px;
        font-weight: normal;
        line-height: 25px;
        color: #515151;
      }

      .post h1{
        font-size: 50px;
        font-weight: 500;
        line-height: 60px;
        margin-bottom: 40px;
        color: inherit;
      }

      .post p {
        margin: 0 0 35px 0;
      }

      .post img {
        border: 1px solid #D9D9D9;
      }

      .post a {
        color: #28A1C5;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="post">
        <h1 class="title">使用itsdangerous生成确认令牌</h1>
        <div class="show-content">
          <p>(venv) $ python manage.py shell<br></p><p>&gt;&gt;&gt; from manage import app</p><p>&gt;&gt;&gt; from itsdangerous import TimedJSONWebSignatureSerializer as Serializer</p><p>&gt;&gt;&gt; s = Serializer(app.config['SECRET_KEY'], expires_in = 3600)<br></p><p>&gt;&gt;&gt; token = s.dumps({ 'confirm': 23 })</p><p>&gt;&gt;&gt; token</p><p>'eyJhbGciOiJIUzI1NiIsImV4cCI6MTM4MTcxODU1OCwiaWF0IjoxMzgxNzE0OTU4fQ.ey ...'</p><p>&gt;&gt;&gt; data = s.loads(token)</p><p>&gt;&gt;&gt; data</p><p>{u'confirm': 23}</p><hr><p>itsdangerous提供了多种生成令牌的方法。其中，TimedJSONWebSignatureSerializer类生成<br></p><p>具有过期时间的JSON Web签名（JSON Web Signatures，JWS）。这个类的构造函数接收</p><p>的参数是一个密钥，在Flask程序中可使用SECRET_KEY设置。</p><p>dumps()方法为指定的数据生成一个加密签名，然后再对数据和签名进行序列化，生成令</p><p>牌字符串。expires_in参数设置令牌的过期时间，单位为秒。</p><p>为了解码令牌， 序列化对象提供了loads()方法，其唯一的参数是令牌字符串。这个方法</p><p>会检验签名和过期时间， 如果通过，返回原始数据。如果提供给loads()方法的令牌不正</p><p>确或过期了，则抛出异常。</p><p>_external=True参数要求程序生成完整的URL，其中包含协议（http://或https://）、主机名和端口。</p>
        </div>
      </div>
    </div>
  </body>
</html>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-运维部署/Ubuntu安装zabbix" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/运维部署/Ubuntu安装zabbix/">Ubuntu安装zabbix</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/运维部署/Ubuntu安装zabbix/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/Ubuntu/">Ubuntu</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        

<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ubuntu安装zabbix</title>
    <style type="text/css" media="all">
      body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
        font-size: 14px;
        line-height: 20px;
        color: #777;
        background-color: white;
      }
      .container {
        width: 700px;
        margin-right: auto;
        margin-left: auto;
      }

      .post {
        font-family: Georgia, "Times New Roman", Times, "SimSun", serif;
        position: relative;
        padding: 70px;
        bottom: 0;
        overflow-y: auto;
        font-size: 16px;
        font-weight: normal;
        line-height: 25px;
        color: #515151;
      }

      .post h1{
        font-size: 50px;
        font-weight: 500;
        line-height: 60px;
        margin-bottom: 40px;
        color: inherit;
      }

      .post p {
        margin: 0 0 35px 0;
      }

      .post img {
        border: 1px solid #D9D9D9;
      }

      .post a {
        color: #28A1C5;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="post">
        <h1 class="title">Ubuntu安装zabbix</h1>
        <div class="show-content">
          <hr><p>1.下载安装文件</p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-50e95badb4eb4203.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-50e95badb4eb4203.png?imageMogr2/auto-orient/strip" data-image-slug="50e95badb4eb4203" data-width="753" data-height="290"><br><div class="image-caption"></div>
</div>
        </div>
      </div>
    </div>
  </body>
</html>

      
    </div>
    
  </div>
  
  
</article>

  
    <article id="post-运维部署/Nginx-反向代理实现多tomcat共用端口" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 itemprop="name">
      <a class="article-title" href="/huafeihua/2019/01/22/运维部署/Nginx-反向代理实现多tomcat共用端口/">Nginx反向代理多个tomcat公用端口</a>
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/huafeihua/2019/01/22/运维部署/Nginx-反向代理实现多tomcat共用端口/" class="article-date">
  <time datetime="2019-01-22T09:58:59.000Z" itemprop="datePublished">2019-01-22</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/huafeihua/categories/技巧/">技巧</a>
  </div>

    
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/huafeihua/tags/Nginx/">Nginx</a></li></ul>

  </div>
  

  <div class="article-inner">
    
    <div class="article-content article-content-doorframe" itemprop="articleBody">
      
        

<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nginx 反向代理实现多tomcat共用端口</title>
    <style type="text/css" media="all">
      body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", sans-serif;
        font-size: 14px;
        line-height: 20px;
        color: #777;
        background-color: white;
      }
      .container {
        width: 700px;
        margin-right: auto;
        margin-left: auto;
      }

      .post {
        font-family: Georgia, "Times New Roman", Times, "SimSun", serif;
        position: relative;
        padding: 70px;
        bottom: 0;
        overflow-y: auto;
        font-size: 16px;
        font-weight: normal;
        line-height: 25px;
        color: #515151;
      }

      .post h1{
        font-size: 50px;
        font-weight: 500;
        line-height: 60px;
        margin-bottom: 40px;
        color: inherit;
      }

      .post p {
        margin: 0 0 35px 0;
      }

      .post img {
        border: 1px solid #D9D9D9;
      }

      .post a {
        color: #28A1C5;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="post">
        <h1 class="title">Nginx 反向代理实现多tomcat共用端口</h1>
        <div class="show-content">
          <p>需求：</p><p>实际工作中有多个应用要使用一个端口的情况，例如两个应用共用80端口。</p><p>工具：</p><h4>nginx-1.13.1</h4><h4>tomcat-7.0.55  2个</h4><hr><p>这里2个tomcat 设为tmocat1，端口9001  ；tomcat2 端口9002 <br></p><p>注：端口一样只能启动一个，你懂的。</p><h4>nginx配置：</h4><p>..\nginx\conf\nginx.conf</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-220e42c94ce368c0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-220e42c94ce368c0.png?imageMogr2/auto-orient/strip" data-image-slug="220e42c94ce368c0" data-width="587" data-height="440"><br><div class="image-caption">nginx配置文件<br>
</div>
</div><p>修改文件前备份是个好习惯，我这里备份的副本。</p><p>修改内容（参考）：</p><p>server {<br></p><p>listen       80;</p><p>server_name  192.168.227.130;  #IP地址<br></p><p>#charset koi8-r;</p><p>#access_log  logs/host.access.log  main;</p><p>location / {</p><p>root   html;</p><p>index  index.html index.htm;</p><p>}</p><p>#############################################</p><p>location /jenkins{</p><p>proxy_pass http://192.168.227.130:9001/jenkins;#主要是这里，这是tomcat1的端口和项目  (公猫)</p><p>proxy_set_header           Host $host;</p><p>proxy_set_header  X-Real-IP  $remote_addr;</p><p>proxy_set_header           X-Forwarded-For $proxy_add_x_forwarded_for;</p><p>client_max_body_size  100m;</p><p>root   html;</p><p>index  index.html index.htm;</p><p>}</p><p>location /server2{</p><p>proxy_pass http://192.168.227.130:9002/;#主要是这里，这是tomcat1的端口和项目  (公猫)</p><p>proxy_set_header           Host $host;</p><p>proxy_set_header  X-Real-IP  $remote_addr;</p><p>proxy_set_header           X-Forwarded-For $proxy_add_x_forwarded_for;</p><p>client_max_body_size  100m;</p><p>root   html;</p><p>index  index.html index.htm;</p><p>}</p><p>###############</p><hr><p>###之间的内容是需要添加的，代理名称一个是jenkins，一个是server2</p><p>启动nginx 即可</p><p><br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-87b3057436bc2a88.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-87b3057436bc2a88.png?imageMogr2/auto-orient/strip" data-image-slug="87b3057436bc2a88" data-width="1096" data-height="632"><br><div class="image-caption">jenkins</div>
</div><p><br></p><p>在server2  端口为9002的tomcat新建了一个2.html页面，访问效果如下<br></p><div class="image-package">
<img src="http://upload-images.jianshu.io/upload_images/4805565-866cdec463020c35.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" data-original-src="http://upload-images.jianshu.io/upload_images/4805565-866cdec463020c35.png?imageMogr2/auto-orient/strip" data-image-slug="866cdec463020c35" data-width="1215" data-height="681"><br><div class="image-caption">server2/2.html</div>
</div><p>访问地址：<br></p><p>http://192.168.227.130/jenkins<br></p><p>http://192.168.227.130/server2</p><p>至此，基于nginx实现2个tomcat 共用一个端口功能实现。</p><p>注意：windows server下 启动nginx 要已管理员身份，否则由于权限问题，无法正常显示页面（css,js...）<br></p>
        </div>
      </div>
    </div>
  </body>
</html>

      
    </div>
    
  </div>
  
  
</article>

  


  <nav id="page-nav">
    
    <span class="page-number current">1</span><a class="page-number" href="/huafeihua/page/2/">2</a><a class="page-number" href="/huafeihua/page/3/">3</a><span class="space">&hellip;</span><a class="page-number" href="/huafeihua/page/6/">6</a><a class="extend next" rel="next" href="/huafeihua/page/2/">下一页 &raquo;</a>
  </nav>


</section>
        <aside id="sidebar">
  
    <div class="widget-box">
  <div class="avatar-box">
    <img class="avatar" src="/huafeihua/images/default-avatar.jpeg" title="图片来自网络">
    <h3 class="avatar-name">
      
        听风看雨
      
    </h3>
    <p class="avatar-slogan">
      抗揍的愤青，半个IT男。
    </p>
  </div>
</div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/Linux/">Linux</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/python/">python</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/入坑/">入坑</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/技巧/">技巧</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/自动化/">自动化</a></li><li class="category-list-item"><a class="category-list-link" href="/huafeihua/categories/项目管理/">项目管理</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">标签</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Appium/">Appium</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Docker/">Docker</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Jenkins/">Jenkins</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Nginx/">Nginx</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Selenium/">Selenium</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/Ubuntu/">Ubuntu</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/centos/">centos</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/flask/">flask</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/rabbit/">rabbit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/sql/">sql</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/ubuntu/">ubuntu</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/效率/">效率</a></li><li class="tag-list-item"><a class="tag-list-link" href="/huafeihua/tags/爬虫/">爬虫</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">标签云</h3>
    <div class="widget tagcloud">
      <a href="/huafeihua/tags/Appium/" style="font-size: 10px;">Appium</a> <a href="/huafeihua/tags/Docker/" style="font-size: 13.33px;">Docker</a> <a href="/huafeihua/tags/Jenkins/" style="font-size: 10px;">Jenkins</a> <a href="/huafeihua/tags/Nginx/" style="font-size: 10px;">Nginx</a> <a href="/huafeihua/tags/Selenium/" style="font-size: 13.33px;">Selenium</a> <a href="/huafeihua/tags/Ubuntu/" style="font-size: 10px;">Ubuntu</a> <a href="/huafeihua/tags/centos/" style="font-size: 16.67px;">centos</a> <a href="/huafeihua/tags/flask/" style="font-size: 20px;">flask</a> <a href="/huafeihua/tags/python/" style="font-size: 20px;">python</a> <a href="/huafeihua/tags/rabbit/" style="font-size: 10px;">rabbit</a> <a href="/huafeihua/tags/sql/" style="font-size: 10px;">sql</a> <a href="/huafeihua/tags/ubuntu/" style="font-size: 10px;">ubuntu</a> <a href="/huafeihua/tags/效率/" style="font-size: 10px;">效率</a> <a href="/huafeihua/tags/爬虫/" style="font-size: 10px;">爬虫</a>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/huafeihua/archives/2019/01/">一月 2019</a></li></ul>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/huafeihua/2019/01/29/python-mq/">python rabbitmq</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/python/Unittest/">Python-Unittest</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/项目管理/项目管理2018-07-23/">U项目管理</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/随笔/-Kanboard-安装之Windows/">Kanboard 安装之Windows</a>
          </li>
        
          <li>
            <a href="/huafeihua/2019/01/22/运维部署/单网卡实现内外网访问/">单网卡实现内外网访问</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
      </div>
      <footer id="footer">
  <div class="foot-box global-width">
    &copy; 2019 Edwin Ma &nbsp;&nbsp;
    驱动于 <a href="http://hexo.io/" target="_blank">Hexo</a><br>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span id="busuanzi_container_site_pv">阁下是第<span id="busuanzi_value_site_pv"></span>个访客</span>
  </div>
</footer>
      <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

<script src="/js/jquery-2.0.3.min.js"></script>

  <link rel="stylesheet" href="/huafeihua/fancybox/jquery.fancybox.css">
  <script src="/huafeihua/fancybox/jquery.fancybox.pack.js"></script>


<script src="/huafeihua/js/script.js"></script>



    </div>
    <nav id="mobile-nav" class="mobile-nav-box">
  <div class="mobile-nav-img mobile-nav-top"></div>
  
    <a href="/huafeihua/" class="mobile-nav-link">首页</a>
  
    <a href="/huafeihua/categories" class="mobile-nav-link">分类</a>
  
    <a href="/huafeihua/archives" class="mobile-nav-link">归档</a>
  
    <a href="/huafeihua/tags" class="mobile-nav-link">标签</a>
  
    <a href="/huafeihua/about" class="mobile-nav-link">关于</a>
  
  <div class="mobile-nav-img  mobile-nav-bottom"></div>
</nav>    
  </div>
</body>
</html>